let a:object;
a = {}; 
a = function (){};


let b: {name: string, age: number};
b = {name : 'liushuong', age: 18};


//  [propName:string]:any 表示任意类型的属性
let c: {name: string, [propName:string]:any};
c = {name: '李淑红', age: 18};

/**
 * 设置函数结构的类型声明：
 *      语法：（形参：类型...）=> 返回值
 */
let d:(a: number, b: number) => number;
d = function (n1: number, n2: number):number {
    return n1 + n2;
};

/**
 * 数组的类型声明：
 *      类型[],
 *      Array<类型>
 */
// string[] 表示字符串数组
let e: string[]
e = ['a', 'b', 'c', 'd'];

let g: Array<number>;


/**
 * 元组， 元祖就是固定长度的数组
 */
let h: [string, number]
h = ['hello', 123]

/**
 * enum 枚举
 */
enum Gender{
    Male = 0,
    Female = 1
}
let i: {name: string, gender: Gender};
i = {
    name: 'liushuhong',
    gender: Gender.Female
}

// &表示同时
let j:{name: string} & {age:number};
j = {name: '孙悟空', age: 18}

// 类型的别名
type myType = 1 | 2|3|4|5;
let k:myType;
k = 1;
export{};